var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
// 类
// 类的属性和方法的修饰符
// static 静态方法  直接用类型调用 不需要实例化对象
// public 公共的   随意调用
// private 私有的 它就不能在声明它的类的外部访问
// protected  受保护的  在当前类的内和子类内部调用
var Car = /** @class */ (function () {
    function Car(name, color, speed) {
        this.name = name;
        this.color = color;
        this.speed = speed;
    }
    // ts的类型 函数的形参类型标注  返回值标注
    Car.prototype.run = function (km) {
        console.log(this.name + km);
        // this.jia()
    };
    Car.prototype.jia = function () {
        console.log("加油");
    };
    Car.prototype.fly = function () {
        console.log("起飞");
    };
    Car.eat = function () {
        console.log("吃是静态方法");
    };
    return Car;
}());
var binli = new Car("宾利欧陆", "蓝色", 280);
binli.run(800);
// 静态方法的调用
Car.eat();
// 车的子类 继承车类
var Byd = /** @class */ (function (_super) {
    __extends(Byd, _super);
    function Byd(city, price) {
        var _this = _super.call(this, "比亚迪", "红色", 280) || this;
        _this.price = price;
        _this.city = city;
        return _this;
    }
    Byd.prototype.make = function () {
        this.fly();
    };
    return Byd;
}(Car));
var byd1 = new Byd("哈尔滨", 19);
byd1.make();
